package sg.edu.nus.iss.phoenix.schedule.dao;

import java.sql.SQLException;
import java.util.List;

import sg.edu.nus.iss.phoenix.schedule.entity.ProgramSlot;
import sg.edu.nus.iss.phoenix.schedule.entity.WeeklySchedule;

/**
 * ProgramSlot Data Access Object. This class contains all database handling that is needed to 
 * implement CRUD operations for the ProgramSlot Object. 
 * @author Wang Shunde
 *
 */
public interface ProgramSlotDAO {
	/***
	 * This method creates a record for each {@link ProgramSlot} in a {@link WeeklySchedule}.
	 * @param weeklySchedule
	 *            The {@link WeeklySchedule} of the program slots.
	 * @throws SQLException
	 */
	void saveProgramSlot(WeeklySchedule weeklySchedule) throws SQLException;
	
	/***
	 * This method returns all the {@link ProgramSlot} in a {@link WeeklySchedule}.
	 * @param selectedWeeklSyScheduleId
	 *            The record id of the {@link WeeklySchedule}.
	 * @return
	 *            A list of {@link ProgramSlot}.
	 * @throws SQLException
	 */
	List<ProgramSlot> searchMatching(long selectedWeeklSyScheduleId) throws SQLException;
	
	
	/***
	 * This method will return a {@link ProgramSlot} with the programSlotId specified
	 * @param programSlotId
	 * 			The id of the {@link ProgramSlot}
	 * @return {@link ProgramSlot}
	 * @throws SQLException
	 */
	ProgramSlot searchMatchingProgramSlot(long programSlotId) throws SQLException;
	
	/***
	 * This method deletes a {@link ProgramSlot} record.
	 * @param programSlotId
	 *            The id of the {@link ProgramSlot}.
	 * @throws SQLException
	 */
	void deleteProgramSlot(long programSlotId) throws SQLException;
	
	/***
	 * This method updates a {@link ProgramSlot} record.
	 * @param ps
	 *            The {@link ProgramSlot} to update.
	 * @param userId
	 *            The id of the {@link User} that initiated the update.
	 * @throws SQLException
	 */
	void updateProgramSlot(ProgramSlot ps, long userId) throws SQLException;
}
